using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations;

namespace Models
{
    /// <summary>
    /// 应用程序用户实体类，继承自Identity框架的IdentityUser
    /// 用于扩展默认的用户属性
    /// </summary>
    public class ApplicationUser : IdentityUser
    {
        /// <summary>
        /// 用户名字
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string FirstName { get; set; } = null!;

        /// <summary>
        /// 用户姓氏
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string LastName { get; set; } = null!;

        /// <summary>
        /// 获取用户全名
        /// </summary>
        public string FullName => $"{FirstName} {LastName}";

        /// <summary>
        /// 用户头像URL
        /// </summary>
        public string? AvatarUrl { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 账户是否已锁定
        /// </summary>
        public bool IsLocked { get; set; }

        /// <summary>
        /// 账户锁定结束时间
        /// </summary>
        public DateTime? LockoutEndTime { get; set; }
    }
} 